package com.bsoft.gol.editor.dao;


import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import com.bsoft.gol.editor.editor.EditorSkipLogic;

import java.util.List;

/**
 * Created by Sangs on 2020/4/3.
 */
public abstract class EditorSkipLogicDAO extends ctd.persistence.support.hibernate.HibernateSupportDelegateDAO<EditorSkipLogic> {

    public EditorSkipLogicDAO() {
        this.setKeyField("skipId");
    }

    @DAOMethod(sql = "delete from EditorSkipLogic where titleId = :titleId")
    public abstract void removeByTitleId(@DAOParam("titleId") String titleId);

    @DAOMethod(sql = "delete from EditorSkipLogic where optionId = :optionId")
    public abstract void removeByOptionId(@DAOParam("optionId") String optionId);

    @DAOMethod(sql = "from EditorSkipLogic where titleId=:titleId ")
    public abstract List<EditorSkipLogic> queryEditorSkipLogicListByTitleId(@DAOParam("titleId") String titleId);


    @DAOMethod(sql = "from EditorSkipLogic where titleId=:titleId and optionId = :optionId")
    public abstract List<EditorSkipLogic> queryEditorSkipLogicListByOptionId(@DAOParam("titleId") String titleId, @DAOParam("optionId") String optionId);

    @DAOMethod(sql = "from EditorSkipLogic where titleId in (:titleIds)")
    public abstract List<EditorSkipLogic> queryEditorSkipLogicByTitleIds(@DAOParam("titleIds") List<String> titleIds);

}